<?php
require_once("lib/api.php");
require_once("lib/auth/session.php");

$api = new api();
/*
 if (isset($_POST['userid'])) {
 $userid = $_POST['userid'];
 if (!is_numeric($userid)) {
 $api->setYouFail("Needs to be a number.");
 } elseif (!($userid > 0)) {
 $api->setYouFail("Needs to be a number larger than 0.");
 } else
 */
if ($id = loggedIn()) {//, JSON_FORCE_OBJECT
    $api->setOK();
    $api->setReturn("userid",$id);
    $api->setReturn("sid",$GLOBALS['TOKEN']);
} else {
    $api->setYouFail("Not logged in.");
}
$api->returnResponse();
?>